import * as types from './mutation-types'
import http from '@/utils/HttpClient'

const state = {
  currentTask: null
}

const mutations = {
  [types.UPDATE_CURRENT_TASK] (_state, data) {
    _state.currentTask = data
  }
}

const actions = {
  goToTaskContent ({ commit, state }, task) {
    commit(types.UPDATE_CURRENT_TASK, task)
    Megalo.navigateTo({ url: '/pages/taskcontent/index?id=' + task.id })
  }
}

const getters = {

}

export default {
  state,
  getters,
  actions,
  mutations
}
